/** 
 * 获取指定的URL参数值 
 * URL:http://www.quwan.com/index?name=tyler 
 * 参数：paramName URL参数 
 * 调用方法:getParam("name") 
 * 返回值:tyler 
 */ 
function getParam(paramName) { 
    /*paramValue = "", isFound = !1; 
    if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) { 
        arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0; 
        while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++ 
    } 
    return paramValue == "" && (paramValue = null), paramValue */
	return GetQueryString(name)
} 
function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null)
        return decodeURI(r[2]);
    return null;
}
function isBlank(a){
	/*if(typeof obj == undefined || obj == null || obj == ""){
        return true;
    }else{
        return false;
    }*/
//  var a = "";
//  var a = " ";
//  var a = null;
//  var a = undefined;
//  var a = [];
//  var a = {};
//  var a = NaN;
  
/*  if(a === undefined) { // 只能用 === 运算来测试某个值是否是未定义的
      console.log("为undefined");
      return true;
  }
  
  if(a == null) { // 等同于 a === undefined || a === null
      console.log("为null");
      return true;
  }
*/
  
  // String    
  if(a == "" || a == null || a == undefined){ // "",null,undefined
      console.log("String为空");
      return true;
  }
  if(!a){ // "",null,undefined,NaN
      console.log("a为空"); 
      return true;
  }
  if(!$.trim(a)){ // "",null,undefined
      console.log("trim()为空");
      return true;
  }

  // Array
 /* if(a.length == 0){ // "",[]
      console.log("lenth为空");
      return true;
  }
  if(!a.length){ // "",[]
      console.log("lenth2为空");
      return true;
  }

  // Object {}
  if($.isEmptyObject(a)){ // 普通对象使用 for...in 判断，有 key 即为 false
      console.log("Object为空");
      return true;
  }*/
  return false;
}
function getCookie(name) {
    var arr;
    var reg = new RegExp("(^|)"+name+"=([^;]*)(;|$)");
    if(arr=document.cookie.match(reg))
        return unescape(arr[2]);
    else
        return null;
}